We found Bactrocera scutellata (Hendel) emerging from stem galls produced by a gall midge, Lasioptera sp., on three wild gourd species, Diplocyclos palmatus (L.) C. Jeffrey, Trichosanthes ovigera Blume, and Zehneria liukiuensis (Nakai) Jeffrey ex Walker, on Okinawa, Japan, a subtropical island. Because B. scutellata preferably attack galls to ungalled parts of gourds, we regard the fruit fly to be a cecidophagous species. Seasonal occurrences of the midge galls on the gourds, the number of galls fed on by B. scutellata, and the fruit fly males captured by cue-lure traps were studied in the northern part of the Island. Midge galls were observed during the period from May to December and fed on by B. scutellata most abundantly in June. Trap data showed that the abundance of male B. scutellata had two peaks; the first in March and the second in June. The second peak was consistent with the occurrence of cecidophagy, whereas the first was not. Host exploitation by B. scutellata is discussed based on the relationship among the gourds, Lasioptera sp., and B. scutellata.